/* Copyright (c) 2024 Huawei Technologies Co., Ltd.
openFuyao is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
         http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN 'AS IS' BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details. */
export const nodeIconFilled = (theme) => (
  <svg id="_图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20">
    <defs>
      <style>
        .cls-1 {{
          fill: 'url(#_未命名的渐变_2-3)',
        }}

        .cls-1, .cls-2, .cls-3, .cls-4, .cls-5, .cls-6, .cls-7, .cls-8, .cls-9 {{
          strokeWidth: '0px',
        }}

        .cls-2 {{
          fill: 'url(#_未命名的渐变_2-9)',
        }}

        .cls-3 {{
          fill: 'url(#_未命名的渐变_2-8)',
        }}

        .cls-4 {{
          fill: 'url(#_未命名的渐变_2)',
        }}

        .cls-5 {{
          fill: 'url(#_未命名的渐变_2-7)',
        }}

        .cls-6 {{
          fill: 'url(#_未命名的渐变_2-6)',
        }}

        .cls-7 {{
          fill: 'url(#_未命名的渐变_2-4)',
        }}

        .cls-8 {{
          fill: 'url(#_未命名的渐变_2-2)',
        }}

        .cls-9 {{
          fill: 'url(#_未命名的渐变_2-5)',
        }}
      </style>
      <linearGradient id="_未命名的渐变_2" data-name="未命名的渐变 2" x1="6.31" y1="3.63" x2="6.31" y2="8.99" gradientTransform="translate(6.31 -2.61) rotate(45)" gradientUnits="userSpaceOnUse">
        <stop offset="0" stop-color="#477dd8" />
        <stop offset="1" stop-color="#234c9e" />
      </linearGradient>
      <linearGradient id="_未命名的渐变_2-2" data-name="未命名的渐变 2" x1="13.77" y1="10.97" x2="13.77" y2="16.58" gradientTransform="translate(13.77 -5.71) rotate(45)" xlink:href="#_未命名的渐变_2" />
      <linearGradient id="_未命名的渐变_2-3" data-name="未命名的渐变 2" x1="13.9" x2="13.9" gradientTransform="translate(8.53 -7.98) rotate(45)" xlink:href="#_未命名的渐变_2" />
      <linearGradient id="_未命名的渐变_2-4" data-name="未命名的渐变 2" x1="6.13" y1="11.57" x2="6.13" y2="16.58" gradientTransform="translate(11.75 -.21) rotate(45)" xlink:href="#_未命名的渐变_2" />
      <linearGradient id="_未命名的渐变_2-5" data-name="未命名的渐变 2" x1="10" y1="6" x2="10" y2="14" gradientTransform="matrix(1,0,0,1,0,0)" xlink:href="#_未命名的渐变_2" />
      <linearGradient id="_未命名的渐变_2-6" data-name="未命名的渐变 2" x1="17" y1="0" x2="17" y2="6" gradientTransform="matrix(1,0,0,1,0,0)" xlink:href="#_未命名的渐变_2" />
      <linearGradient id="_未命名的渐变_2-7" data-name="未命名的渐变 2" x1="17" y1="14" x2="17" y2="20" gradientTransform="matrix(1,0,0,1,0,0)" xlink:href="#_未命名的渐变_2" />
      <linearGradient id="_未命名的渐变_2-8" data-name="未命名的渐变 2" x1="3" y1="0" x2="3" y2="6" gradientTransform="matrix(1,0,0,1,0,0)" xlink:href="#_未命名的渐变_2" />
      <linearGradient id="_未命名的渐变_2-9" data-name="未命名的渐变 2" x1="3" y1="14" x2="3" y2="20" gradientTransform="matrix(1,0,0,1,0,0)" xlink:href="#_未命名的渐变_2" />
    </defs>
    <g id="_图层_1-2" data-name="图层 1">
      <rect class="cls-4" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} x="5.31" y="3.52" width="2" height="5.58" transform="translate(-2.61 6.31) rotate(-45)" />
      <rect class="cls-8" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} x="12.77" y="10.81" width="2" height="5.93" transform="translate(-5.71 13.77) rotate(-45)" />
      <rect class="cls-1" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} x="11.11" y="5.31" width="5.58" height="2" transform="translate(-.39 11.67) rotate(-45)" />
      <rect class="cls-7" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} x="3.59" y="13.07" width="5.07" height="2" transform="translate(-8.16 8.46) rotate(-45)" />
      <path class="cls-9" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} d="m10,14c-2.21,0-4-1.79-4-4s1.79-4,4-4,4,1.79,4,4-1.79,4-4,4Z" />
      <path class="cls-6" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} d="m17,0c-1.66,0-3,1.34-3,3s1.34,3,3,3,3-1.34,3-3-1.34-3-3-3h0Z" />
      <path class="cls-5" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} d="m17,14c-1.66,0-3,1.34-3,3s1.34,3,3,3,3-1.34,3-3-1.34-3-3-3h0Z" />
      <path class="cls-3" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} d="m3,0C1.34,0,0,1.34,0,3s1.34,3,3,3,3-1.34,3-3S4.66,0,3,0h0Z" />
      <path class="cls-2" strokeWidth='0px' fill={theme === 'light' ? 'url(#_未命名的渐变_2)' : '#fff'} d="m3,14c-1.66,0-3,1.34-3,3s1.34,3,3,3,3-1.34,3-3-1.34-3-3-3h0Z" />
    </g>
  </svg>
);

const nodeIconOutlined = (theme) => (
  <svg id="节点" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
    <defs>
      <style>
        .cls-1 {{
          fill: '#89939b',
          strokeWidth: '0px',
        }}
      </style>
    </defs>
    <g id="_图层_1-2" data-name="图层 1">
      <path class="cls-1" strokeWidth='0px' fill='#89939b' d="m17,2c.55,0,1,.45,1,1s-.45,1-1,1-1-.45-1-1,.45-1,1-1m0-2c-1.66,0-3,1.34-3,3s1.34,3,3,3,3-1.34,3-3-1.34-3-3-3h0Z" />
      <path class="cls-1" strokeWidth='0px' fill='#89939b' d="m17,16c.55,0,1,.45,1,1s-.45,1-1,1-1-.45-1-1,.45-1,1-1m0-2c-1.66,0-3,1.34-3,3s1.34,3,3,3,3-1.34,3-3-1.34-3-3-3h0Z" />
      <path class="cls-1" strokeWidth='0px' fill='#89939b' d="m3,2c.55,0,1,.45,1,1s-.45,1-1,1-1-.45-1-1,.45-1,1-1m0-2C1.34,0,0,1.34,0,3s1.34,3,3,3,3-1.34,3-3S4.66,0,3,0h0Z" />
      <path class="cls-1" strokeWidth='0px' fill='#89939b' d="m3,16c.55,0,1,.45,1,1s-.45,1-1,1-1-.45-1-1,.45-1,1-1m0-2c-1.66,0-3,1.34-3,3s1.34,3,3,3,3-1.34,3-3-1.34-3-3-3h0Z" />
      <path class="cls-1" strokeWidth='0px' fill='#89939b' d="m10,14c-2.21,0-4-1.79-4-4s1.79-4,4-4,4,1.79,4,4-1.79,4-4,4Zm0-6c-1.1,0-2,.9-2,2s.9,2,2,2,2-.9,2-2-.9-2-2-2Z" />
      <rect class="cls-1" strokeWidth='0px' fill='#89939b' x="5.31" y="3.52" width="2" height="5.58" transform="translate(-2.61 6.31) rotate(-45)" />
      <rect class="cls-1" strokeWidth='0px' fill='#89939b' x="12.77" y="10.81" width="2" height="5.93" transform="translate(-5.71 13.77) rotate(-45)" />
      <rect class="cls-1" strokeWidth='0px' fill='#89939b' x="11.11" y="5.31" width="5.58" height="2" transform="translate(-.39 11.67) rotate(-45)" />
      <rect class="cls-1" strokeWidth='0px' fill='#89939b' x="3.59" y="13.07" width="5.07" height="2" transform="translate(-8.16 8.46) rotate(-45)" />
    </g>
  </svg>
);

export default function NodeIcon(selected, theme) {
  return (
    <div className="menu-icon">
      {selected ? nodeIconFilled(theme) : nodeIconOutlined(theme)}
    </div>
  );
}